package com.zatech.cgnci.project.base.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * 理赔案件状态
 */
@Getter
@AllArgsConstructor
public enum ClaimCaseStatusEnum {
    NO_CLAIM("1", "未立案"),
    CLAIM("2", "已立案"),
    CLOSE("3", "已结案"),
    REOPEN("4", "重开中"),
    LOG_OFF("5", "已注销"),
    ;

    public static ClaimCaseStatusEnum getEnumByCode(String code) {
        return Arrays.stream(values()).filter(e -> Objects.equals(e.getCode(), code)).findAny().orElse(null);
    }

    private String code;
    private String descr;
}
